import type { CardListData,CardListParams,CardParams,CardDetail } from "@/types/card"
import { request } from "@/utils/reuqest"

export const getCardListAPI = (params: CardListParams) => {
  return request<CardListData>('/parking/card/list','GET',params)
}


export const createCardAPI = (params:Partial< CardParams>) => {
  return request('/parking/card','POST',params)
}
export const getCardDetailAPI = (id: string) => {
  return request<CardDetail>(`/parking/card/detail/${id}`)
}
export const updateCardAPI = (data: Partial<CardDetail>) => {
  return request(`/parking/card/edit`, 'PUT', data)
}
export const delCardAPI = (ids: number[]) => {
  return request(`/parking/card/${ids.join(',')}`, 'DELETE')
}